package com.android.hw.projectmenu;


import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.os.SystemProperties;
import android.preference.Preference;
import android.preference.PreferenceActivity;
import android.preference.PreferenceGroup;
import android.util.Log;

import com.android.internal.telephony.Phone;
import com.android.internal.telephony.PhoneFactory;
import com.android.hw.projectmenu.R;
import android.app.ActivityManager;

public class WifiTest extends PreferenceActivity {

	private static String KEY_WIFI_TX_TEST = "wifi_tx_test";
	private static String KEY_WIFI_RX_TEST = "wifi_rx_test";
	private static String KEY_WIFI_SCW_TEST = "wifi_scw_test";
	
    @Override
    protected void onCreate(Bundle icicle) {
        super.onCreate(icicle);
        /*15-10-28 gaoshenpan if runing monkeyTest this finish begin*/
		if(isMonkeyRunning()){
			this.finish();
		}
		/*15-10-28 gaoshenpan if runing monkeyTest this finish end*/
        addPreferencesFromResource(R.xml.wifi);
        Intent txIntent = new Intent();
        txIntent.setClassName("com.qti.fcctest", "com.qti.fcctest.FccTestActivity");
        txIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        txIntent.putExtra("type", "tx");
        Preference txPreference = findPreference(KEY_WIFI_TX_TEST);     
        txPreference.setIntent(txIntent);
        
        Intent rxIntent = new Intent();
        rxIntent.setClassName("com.qti.fcctest", "com.qti.fcctest.FccTestActivity");
        rxIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        rxIntent.putExtra("type", "rx");
        Preference rxPreference = findPreference(KEY_WIFI_RX_TEST);
        rxPreference.setIntent(rxIntent);
        
        Intent scwIntent = new Intent();
        scwIntent.setClassName("com.qti.fcctest", "com.qti.fcctest.FccTestActivity");
        scwIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        scwIntent.putExtra("type", "scw");
        Preference scwPreference = findPreference(KEY_WIFI_SCW_TEST);
        scwPreference.setIntent(scwIntent);
        
    }
    
    /*15-10-28 gaoshenpan add judge if runing monkeyTest begin*/
	public static boolean isMonkeyRunning() {
		return ActivityManager.isUserAMonkey();
	}
	/*15-10-28 gaoshenpan add judge if runing monkeyTest end*/
   

}
